package com.example.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.domin.Vo.Dieases;
import com.example.demo.domin.Vo.GenderVo;
import com.example.demo.domin.entity.Analytics;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface ChartMapper extends BaseMapper<Analytics> {

    @Select("select count(*) from user_activity where DATE(activity_date) = #{date}")
    int dailyChart(Date date);
    @Select("SELECT gender,COUNT(*) as count FROM `user_activity` where DATE(activity_date) = #{date} GROUP BY gender ")
    List<GenderVo> activeUsers(Date date);
    @Select("select dieases,count(*) as count from user_activity where DATE(activity_date) = #{date} group by dieases")
    List<Dieases> diseaseCount(Date date);
}
